﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<VERKProjectHopur16.Models.QA>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	AllQA
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Questions and Answers</h2>

    <div>
        <input type="button" onclick="document.location.href = '<%: Url.Action("CreateQA", "QA") %>'" value="Add Question" />
    </div>

    <div class="admincontentlist">
        <table>
            <thead>
                <tr>
                    <th><%= Html.ActionLink("Name", "OrderQA", new { id = 1 })%></th>
                    <th><%= Html.ActionLink("Insert date", "OrderQA", new { id = 2 })%></th>
                    <th><%= Html.ActionLink("Department", "OrderQA", new { id = 3 })%></th>
                    <th><%= Html.ActionLink("Answered", "OrderQA", new { id = 5 })%></th>
                    <th></th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <% foreach (var item in Model) 
                { %>
                <tr>
                    <td><%: item.Question %></td>
                    <td><%: item.InsertDate.ToString("dddd, dd MMMM yyyy")%></td>  
                    <td><%: item.Department.Name %></td>   
                    <td><%: item.Answered %></td>        
                    <td><input type="button" onclick="document.location.href = '<%: Url.Action("EditQA", new { id = item.QAID }) %>'" value="Edit" /></td>                 
                    <td><input type="button" onclick="document.location.href = '<%: Url.Action("RemoveQA", new { id = item.QAID }) %>'" value="Delete" /></td> 
                </tr>
                <% } %>
            </tbody>
        </table>
    </div> 
</asp:Content>
